# Makefile.in for kaffe - a Java(tm) compatible virtual machine.
#
# Copyright (c) 1996 Systems Architecture Research Centre,
#		   City University, London, UK.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# Written by Tim Wilkinson <tim@sarc.city.ac.uk>, February 1996.

VPATH=		@srcdir@:@srcdir@/codegen
srcdir=		@srcdir@
prefix=		@prefix@
exec_prefix=	@exec_prefix@
bindir=		@bindir@
INSTALL=	@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
CC=		@CC@
CFLAGS=		@CFLAGS@ -I. -I$(srcdir) -I$(srcdir)/codegen
LDFLAGS=	@LDFLAGS@ @kaffe_share@
LIBS=		@LIBS@
OBJECT=\
		instn.o \
		gen.o \
		translator.o \
		instruction.o \
		register.o \
		code.o \
		lookup.o \
		soft1.o \
		soft2.o \
		native.o \
		constants.o \
		classMethod.o \
		readClass.o \
		findClass.o \
		baseClasses.o \
		object.o \
		exception.o \
		itypes.o \
		gc.o \
		thread.o \
		locks.o \
		threadCalls.o \
		support.o \
		zextract.o \
		main.o

all:
		@$(MAKE) mkgen
		@$(MAKE) mkkaffe

mkgen:		bytecode.h

mkkaffe: 	kaffe

kaffe:		$(OBJECT)
		$(CC) $(LDFLAGS) -o kaffe $(OBJECT) $(LIBS)

gen.o:		gen.c gen.h asm.h

bytecode.h gen.h gen.c instn.c:	kaffe.def
		../kaffe2native/kaffe2native $(srcdir) kaffe.def

clean:
		rm -f kaffe kaffe.core $(OBJECT)

distclean:	clean
		rm -f needs.h md.h gen.h gen.c bytecode.h
		rm -f instn.c asm.h kaffe.def
		rm -f Makefile config.log config.status

install:
		-mkdir -p $(bindir)
		$(INSTALL_PROGRAM) kaffe $(bindir)/kaffe
